//==========================================================================
// Copyright (c) 2000-2008,  Elastos, Inc.  All Rights Reserved.
//==========================================================================

#include <bsp.h>

BspGlobals bsp = {
    NULL,           // *szCpuDescription
    NULL,           // *szBoardDescription
    
    NULL,           // paKernelPhysBase
    NULL,           // paKernelImagePhysBase
    
    NULL,           // *pMemoryZones
    0,              // uNumberOfMemoryZones
    
    NULL,           // *pMemoryHoles
    0,              // uNumberOfMemoryHoles
    
    0,              // uDmaPreferredZoneNo
    0,              // uKernelPreferredZoneNo
    0,              // uUserPreferredZoneNo
    
    {0, 0},         // regionOfInitStack
    
    NULL,           // *pBootModules
    0,              // uNumberOfBootModules
    {0, 0},         // regionOfBootModules
    
    NULL,           // *szBootCommandLine
    
    0,              // uIrqBase
    0,              // uNumberOfIrqs
    
    0,              // irqOfPIT
    0               // iplOfPIT
};

extern "C" void mainCRTStartup() 
{
    KrnSetup((physaddr_t)0, (physaddr_t)0, 0, 0, 0, 0);
    
    KrnInitialize();
    
    KrnStartup();
}

EXTERN_C void CDECL BspIdle()
{
}

EXTERN_C void CDECL BspHalt()
{
}

EXTERN_C void CDECL BspReboot()
{
}

EXTERN_C void CDECL BspBeep()
{
}

EXTERN_C bool_t CDECL BspSetupComPort(
        ComPort comPort, const ComPortSettings *pSettings)
{
    return TRUE;
}
        	
EXTERN_C bool_t CDECL BspReadComPort(ComPort comPort, uint8_t *pu8Data)
{
    return TRUE;
}

EXTERN_C bool_t CDECL BspWriteComPort(ComPort comPort, uint8_t u8Data)
{
    return TRUE;

}

EXTERN_C irqs_t CDECL BspGetIrqs()
{
    return 0;
}

EXTERN_C void CDECL BspMaskIrqs(irqs_t irqs, bool_t bEnable)
{
}

EXTERN_C void CDECL BspMaskAllIrqs(bool_t bEnable)
{
}

EXTERN_C void CDECL BspAcknowledgeIrq(irq_t irq)
{
}

EXTERN_C void   CDECL BspReloadPIT()
{
}

EXTERN_C uint_t CDECL BspGetPITTime()
{
    return 0;
}

EXTERN_C void   CDECL BspGetRTCTime(RTCTime *pRTCTime)
{
}

EXTERN_C void   CDECL BspSetRTCTime(const RTCTime *pRTCTime)
{
}

//
// Console
//
EXTERN_C void CDECL BspWriteConsole(const char *szMessage)
{
}
